import request from '@/utils/request';
import store from '@/store'

// 列表查询
export function searcgTmeplatList(data) {
    return request({
        url: '/maintain/maintain/template/list',
        method: 'get',
        params: data
    })
}

// 新增接口
export function addTemplate(data) {
    const params = {
        ...data,
        createUserId: store.getters.userId,
        updateUserId: store.getters.userId
    }
    return request({
        url: '/maintain/maintain/template/addTemplate',
        method: 'post',
        data: params
    })
}

// 修改接口
export function editTemplate(data) {
    const params = {
        ...data,
        updateUserId: store.getters.userId
    }
    return request({
        url: '/maintain/maintain/template/editTemplate',
        method: 'post',
        data: params
    })
}

// 删除接口
export function deleteTemplate(data) {
    return request({
        url: `/maintain/maintain/template/deleteTemplate/${data}`,
        method: 'delete'
    })
}

// 模板详情
export function detailsTemplate(data) {
    return request({
        url: `/maintain/maintain/template/getTemplateInfo/${data}`,
        method: 'get'
    })
}